package com.asha.vrlib.strategy.display;

import android.content.Context;
import android.graphics.Point;
import android.util.Log;

import com.asha.vrlib.MD360Director;
import com.asha.vrlib.strategy.IModeStrategy;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by hzqiujiadi on 16/3/19.
 * hzqiujiadi ashqalcn@gmail.com
 */
public abstract class AbsDisplayStrategy implements IModeStrategy, IDisplayMode {

    public static float DEFINE_X_EXTRA = 120;

    DisplayModeManager.Params mParams;

    public List<Point> mPoss;
    public List<Point> mSizes;

    public AbsDisplayStrategy() {
    }

    public AbsDisplayStrategy(DisplayModeManager.Params params) {
        mParams = params;
    }

    @Override
    public void onResume(Context context) {

    }

    @Override
    public void onPause(Context context) {

    }

    protected List<MD360Director> getDirectorList() {
        return mParams.projectionModeManager.getDirectors();
    }

    @Override
    public void onSurfaceChanged(int width, int height) {
        mPoss = new ArrayList<>(1);
        mSizes = new ArrayList<>(1);
        mPoss.add(new Point(0, 0));
        mSizes.add(new Point(width, height));
    }

    @Override
    public int getVisibleSize() {
        return 1;
    }

    @Override
    public List<Point> getDisplayPoss() {
        return mPoss;
    }

    @Override
    public List<Point> getDisplaySizes() {
        return mSizes;
    }
}
